package com.minjie.service;

import com.minjie.mapper.TaskMapper;
import com.minjie.pojo.Task;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class TaskService {
    @Autowired
    private TaskMapper taskMapper;

    public void addTask(Task task, Integer id) {
        task.setUid(id);
        taskMapper.insertTask(task);
    }

    public List<Task> getTasksByUserId(Integer id) {
        return taskMapper.getTasksByUserId(id);
    }

    public void updateTask(Task task, Integer id) {
        task.setUid(id);
        taskMapper.updateTask(task);
    }
}
